package org.xhy.quickstarter.advice;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.xhy.quickstarter.authority.utils.R;

/**
 * @description:
 * @Author: Xhy
 * @CreateTime: 2023-11-18 21:27
 */
@RestControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public R ex(Exception e){
        e.printStackTrace();
        return R.error().message(e.getMessage());
    }
}
